From: Florian Müllner Date: Wed, 23 Feb 2011 17:56:51 +0000 (+0100) Subject: panel: Add a relayout() method to position the panel X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8877 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=172d68d1fe47a097bc6f78cf2ce9758cca5a2ba9;p=gnome-shell.git panel: Add a relayout() method to position the panel Currently the panel is positioned from main.js, move that code into a method in panel.js instead and call it from main.js, which is consistent with what we do for the overview. https://bugzilla.gnome.org/show_bug.cgi?id=643064 --- diff --git a/js/ui/main.js b/js/ui/main.js index a1b4a3bb4..448ce990c 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -417,8 +417,7 @@ function _relayout() { panel.setHotCorner(corner); } - panel.actor.set_position(primary.x, primary.y); - panel.actor.set_size(primary.width, Panel.PANEL_HEIGHT); + panel.relayout(); overview.relayout(); // To avoid updating the position and size of the workspaces diff --git a/js/ui/panel.js b/js/ui/panel.js index 136eb9346..6fa03473a 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -1058,6 +1058,13 @@ Panel.prototype = { }); }, + relayout: function() { + let primary = global.get_primary_monitor(); + + this.actor.set_position(primary.x, primary.y); + this.actor.set_size(primary.width, PANEL_HEIGHT); + }, + _onTrayIconAdded: function(o, icon, role) { icon.height = PANEL_ICON_SIZE;